package com.qf.mvc2203.controller;

import com.qf.mvc2203.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/param")

public class ParamController {
    @RequestMapping("/test1")
    public String test1(Integer id,String name,boolean flag){
        System.out.println(id);
        System.out.println(name);
        System.out.println(flag);
        return "/hi.html";
    }
    @RequestMapping("test2")
    public String test2(User user){
        System.out.println(user);
        return "/hi.html";

    }
    @RequestMapping("/test3")
    public String test3(String[] hobby){
        for (int i = 0; i < hobby.length; i++) {
            System.out.println(hobby[i]);
        }
        return "/hi.html";
    }
    @RequestMapping("/get/{name}")
    public String test4(@PathVariable("name") String name){
        System.out.println(name);
        return "/hi.html";
    }

}
